package com.wangx1n;

import com.wangx1n.service.UserService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author WangXin
 * @date 2020/12/3 18:28
 */
public class myTest {
    @Test
    public void DIAnnotationTest(){
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        UserService userService = context.getBean("userService", UserService.class);

        userService.getUserDao().getUserInfo();

        System.out.println(userService.getName());
    }
}
